home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / amiga.free / sorgenti vari / wolfedit2 2.0.4 source.sit / WolfEdit2 2.0.4 Source / WolfMap ƒ / UMapGrid.p < prev    next >
Text File  |  1994-11-10  |  1KB  |  52 lines

  1. unit UMapGrid;
  2.  
  3. interface
  4.     uses
  5.         HexIO, ULevel, UMapParams, UDrawing;
  6.  
  7.     procedure MapGrid (level: LevelHandle;
  8.                                     layers: MapLayers;
  9.                                     vis: Rect);
  10.  
  11. implementation
  12.  
  13.     procedure MapGrid (level: LevelHandle;
  14.                                     layers: MapLayers;
  15.                                     vis: Rect);
  16.         var
  17.             row, col: integer;
  18.             x, y: integer;
  19.     begin
  20.         if gridLayer in layers then begin
  21.                 PenNormal;
  22.                 for row := 0 to 64 do begin
  23.                         y := margin + row * cellSize;
  24.                         MoveTo(margin, y);
  25.                         Line(64 * cellSize, 0);
  26.                         MoveTo(1, y - 1);
  27.                         DrawString(Hex(row, 2));
  28.                     end;
  29.                 for col := 0 to 64 do begin
  30.                         x := margin + col * cellSize;
  31.                         MoveTo(x, margin);
  32.                         Line(0, 64 * cellSize);
  33.                         MoveTo(x + 3, margin - fontDescent);
  34.                         DrawString(Hex(col, 2));
  35.                     end;
  36.                 PenSize(2, 2);
  37.                 for row := 0 to 64 do
  38.                     if BAND(row, $3) = 0 then begin
  39.                             y := margin + row * cellSize;
  40.                             MoveTo(0, y);
  41.                             Line(margin + 64 * cellSize, 0);
  42.                         end;
  43.                 for col := 0 to 64 do
  44.                     if BAND(col, $3) = 0 then begin
  45.                             x := margin + col * cellSize;
  46.                             MoveTo(x, 0);
  47.                             Line(0, margin + 64 * cellSize);
  48.                         end;
  49.             end;
  50.     end;
  51.  
  52. end.